const f = async function() {
    var m = await Promise.resolve(1);
    var n = await Promise.resolve(2);
    console.log({m, n});
    return "async finished";
}

f().then(result => console.log(result));

const fg = function* () {
    var m = yield Promise.resolve(1);
    var n = yield Promise.resolve(2);
    console.log({m, n});
}

a = fg();

let auto = (result) => {
    let v = a.next(result);
    if(v.done) return;
    v.value.then(result => auto(result));
}

auto();